/**
 * 
 */
package vn.org.cmt.cms.service;

import java.util.List;

import vn.org.cmt.cms.dao.ModuleDao;
import vn.org.cmt.cms.model.Module;


/**
 * @author sonnt
 *
 */
public interface ModuleManager extends UniversalManager {
	/**
     * Convenience method for testing - allows you to mock the DAO and set it on an interface.
     * @param userDao the UserDao implementation to use
     */
    void setModuleDao(ModuleDao moduleDao);

    /**
     * Retrieves a user by userId.  An exception is thrown if user not found
     *
     * @param userId the identifier for the user
     * @return User
     */
    Module getModule(String moduleId);

    /**
     * Finds a user by their username.
     * @param username the user's username used to login
     * @return User a populated user object
     * @throws org.springframework.security.userdetails.UsernameNotFoundException
     *         exception thrown when user not found
     */
    Module getModuleByUsername(String modulename) throws Exception;

    /**
     * Retrieves a list of users, filtering with parameters on a user object
     * @param user parameters to filter on
     * @return List
     */
    List getModules(Module module);

    /**
     * Saves a user's information.
     *
     * @param user the user's information
     * @throws UserExistsException thrown when user already exists
     * @return user the updated user object
     */
    Module saveModule(Module module) throws Exception;

    /**
     * Removes a user from the database by their userId
     *
     * @param userId the user's id
     */
    void removeModule(String moduleId);
}
